//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2006 CORE Solutions Limited
// All rights reserved.
// PROPRIETARY AND CONFIDENTIAL INFORMATION.
// Use is subject to license terms.
//
// FUNCTION ID      :   COMMITMENT1BA
// AUTHOR           :   Alex Cheung 
// DATE CREATE      :   2006/06/28
// DESCRIPTION      :   a COMMON DELEGATE file for the function, COMMITMENT1BA
//                  :   
//                  :   
//                  :   
//
// MODIFICATION HISTORY:
// DATE         AUTHOR          VERSION NO.         COMMENT
// -----------  --------------  ------------------  -------------------
// 2006/06/28   Alex Cheung     1.0                 source is generated.
//
//
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

package com.erp.app.catalog.catgroup.delegate;

import java.sql.Connection;

import javax.transaction.UserTransaction;

import com.erp.app.common.ProjectConstants;
import com.erp.app.common.util.DocumentNumberGenerator;
import com.erp.app.common.util.ProjectDbObjectUtil;
import com.erp.framework.model.dao.ServiceLocator;
import com.erp.framework.util.logger.Logger;
import com.erp.framework.exceptions.FindRecordException;
import com.erp.app.catalog.catgroup.bizLogic.CatalogGroupCommonUtil;
import com.erp.app.catalog.catgroup.criteria.CatalogGroupCriteria;
import com.erp.app.catalog.catgroup.dao.CatalogGroupCommonDao;


import java.util.ArrayList;


/**
* <p>A <strong>Delegate</strong> provides the logical flow and control
* of the business model.
*
* @author          Alex Cheung 
* @version 1.0     2006/06/28
* @since           FrameWork 1.1
*
*/
public class CatalogGroupCommonDelegate {
	
	private CatalogGroupCommonUtil util = new CatalogGroupCommonUtil();
	private CatalogGroupCommonDao dao = new CatalogGroupCommonDao();
	
	public ArrayList findByCriteria(CatalogGroupCriteria criteria) throws FindRecordException {
		Connection conn = null;
		ArrayList rsltList = new ArrayList();

		try {
			ServiceLocator srvLocator = ServiceLocator.getInstance();
			conn = srvLocator.getDSDBConnection();
			rsltList = (ArrayList) dao.findByCriteria(criteria, conn);

		} catch (Exception e) {
			Logger.logExceptions(this, e);
			throw new FindRecordException(e.getMessage());
		} finally {
		try {
				conn.close();
			} catch (Exception e) {
				Logger.logExceptions(this, e);
			}
		}

		return rsltList;
	}
	
}